﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SugarWebApi.Commands
{

	public class LoginParameters : SugarWebParameters
	{

		#region Constructors

		public LoginParameters(
			string username,
			string password)
			: this(username, password, string.Empty)
		{
		}

		public LoginParameters(
			string username,
			string password,
			string encryptionkey)
		{
			this.Username = username;
			this.Password = password;
			this.Encryptionkey = encryptionkey;
		}

		#endregion

		#region Properties

		public string Encryptionkey
		{
			get;
			set;
		}

		public string Password
		{
			get;
			set;
		}

		public string PasswordDigest
		{
			get { return SugarWebUtil.ComputePasswordDigest(this.Password, this.Encryptionkey); }
		}

		public string Username
		{
			get;
			set;
		}

		#endregion

	}
}
